import request from '@/utils/request'
export const getEmployeesAPI = ({ page, size }) => {
  return request({
    url: '/sys/user',
    params: { page, size }
  })
}
// 删除员工
export function delEmployeeAPI(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}
// 新增员工
export const addEmployessAPI = ({ username,
  mobile,
  formOfEmployment,
  workNumber,
  departmentNam,
  timeOfEntry,
  correctionTime	}) => {
  return request({
    url: '/sys/user',
    method: 'POST',
    data: {
      username,
      mobile,
      formOfEmployment,
      workNumber,
      departmentNam,
      timeOfEntry,
      correctionTime

    }
  })
}
// 批量导入
export const AllEmployessAPI = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}
// 员工个人信息
export const PersonalInformationAPI = (id) => {
  return request({
    url: `/sys/user/${id}`
  })
}
// 更新员工基本信息
export const UpdateEmployeeInformationAPI = (id, data) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'PUT',
    data
  })
}

// 员工分配角色
export const AssignPermissionsAPI = (data) => {
  return request({
    url: `/sys/user/assignRoles`,
    method: 'PUT',
    data
  })
}
// 获取所有员工权限
export const GetEmployeePermissionsAPI = (params) => {
  return request({
    url: `/sys/role`,
    params
  })
}

